/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.UnsupportedEncodingException;

/**
 * <p>Project: javaseapp - Str1
 * <p>Powered by webrx On 2021-08-06 10:36:52
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Str4 {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String a = "ok";
        System.out.println(a);
        String b = "ok";
        System.out.println(b);
        System.out.println(a == b);
        System.out.println(a.equals(b));

        String x = new String("ok");
        System.out.println(x);
        String y = new String("OK");
        System.out.println(y);
        System.out.println(x == y);// == 是判断是不是同一个对象
        System.out.println(x.equals(y));//false equals() 是判断字符串对象的值一样吗？
        System.out.println(x.equalsIgnoreCase(y));//true 忽略大小写比较值内容是不是一样的。
    }
}
